<template>
    <div>
        <h3>cate页面讲解vuex的使用</h3>
        <v-one></v-one>
        <v-two></v-two>
        <!-- <button  @click="$store.state.num=9">修改state中的值</button> -->
        <button @click="changeNum">修改num的值</button>
        <button @click="changeNameaAsync">异步修改name的值</button>
    </div>
</template>

<script>
import  vOne from "./components/One.vue"
import  vTwo from  "./components/Two.vue"
// import  { mapActions,mapMutations } from  "vuex";
export default {
        components:{
            vOne,vTwo
        },
        methods:{
            changeNum(){
                this.$store.commit("changeNum",30)
            },
            changeNameaAsync(){
                this.$store.dispatch("changeNameaAsync","翠花")
            }
        }
    }
</script>

<style  scoped>

</style>